package yxy.game.pm2.active.module;

import yxy.apple.util.PubSub.MethodSubscriber;
import yxy.apple.util.PubSub.SubscriptionMethod;
import yxy.game.pm2.bean.pubsub.TaskPublisher;
import yxy.game.pm2.bean.pubsub.TaskPublisher.TaskSubscription;

public class ActiveSubscriber_七日目标 extends MethodSubscriber {

	static private ActiveSubscriber_七日目标 instance;

	public static ActiveSubscriber_七日目标 getInstance() {
		if (instance == null) {
			instance = new ActiveSubscriber_七日目标();
			instance.init();
		}
		return instance;
	}

	private void init() {
		TaskPublisher.getInstance().subscribe(this);
	}
	
	private ActiveSubscriber_七日目标() {
	}

	@SubscriptionMethod(Type = TaskSubscription.class)
	public void receive(TaskSubscription subscription) {

		String playerCode = subscription.getPlayerCode();
//		Map<String, Task> alltask = subscription.getAllTask();

		ActiveModule_七日目标 am = ActiveModule_七日目标.get(playerCode,false);
//		HashMap<String, sdtask> codetaskmap = am.getCodetaskmap();
		
//		if(am.getEndtime().isBeforeNow()) {
//			return;
//		}
		
//		am.check();
		
//		for(String code : codetaskmap.keySet()) {
//			Task task = alltask.get(code);
//			if(task == null) {
//				continue;
//			}
//			
//			sdtask sd = codetaskmap.get(code);
//			if(am.getDays() < sd.getGroup()) {
//				return;
//			}
//						
//			if(task.isFinish() && !task.isReward()) {
//				new TipHandle().updateTip(playerCode, TipType.活动_七日目标奖励, true);	
//				return;
//			}
//		}
//		
//		new TipHandle().updateTip(playerCode, TipType.活动_七日目标奖励, false);	
	}
}
